package com.tledu.ifelse;

import java.util.Scanner;

public class Calculator {
    public static void main(String[] args) {
        // 实现一个四则运算
        Scanner scanner = new Scanner(System.in);
        System.out.print("请输入第一个数字：");
        int a = scanner.nextInt();
        System.out.print("请输入第操作符号：");
        String operator = scanner.next();
        System.out.print("请输入第二个数字：");
        int b = scanner.nextInt();
        switch (operator) {
            case "+":
                System.out.println(a+operator+b+"="+(a+b));
                break;
                // ...
            default:
                System.out.println("未知运算符");
        }
    }
}
